/*
 * @Descripttion:
 * @Author: linwc
 * @Date: 2022-03-22 11:10:48
 * @LastEditors: xiaodong 565071984@qq.com
 * @LastEditTime: 2022-05-06 22:00:21
 */
// import { setStorage } from '../../../utils/';
import { getLanguage } from '@/lang/index'

const state = {
  language: getLanguage(),
}

const mutations = {
  SET_LANGUAGE: (state, language) => {
    state.language = language
    localStorage.setItem('language', language)
  },
}

const actions = {
  setLanguage({ commit }, language) {
    commit('SET_LANGUAGE', language)
  },
}

const getters = {
  language: (state) => state.language,
}

export default { state, getters, mutations, actions }
